<script>
    
    $(document).ready(function(){
        
      $("#submit").click(function(){
          
        $.post(
            "/login", 
            { 
               signin_email:$("#signin_email").val(),
               signin_password:$("#signin_password").val()
            },
            function(data){
                if(data.status=="error"){
                     $("#notice").removeClass("hidden-element").text(data.error);
                 }
            //$("label[for=email]").text(data.email);}
                else if(data.status=="success"){
                    $("#model").remove();
                   // $("#login").remove();
                    $("#user_in").removeClass("logged-in").addClass("logged-out");
                    $("#user_out").removeClass("logged-out").addClass("logged-in");
                    $("#user_name").text(data.user);
                    
            }
            }, 
            "json"
        );
           // return false;
           event.preventDefault();
      });
      $("#signin_email").focusout(function () { 
          var re=/^(([a-zA-Z0-9_\-.]+)@([a-zA-Z0-9\-]+)\.[a-zA-Z0-9\-.]+$)/;
            
          if(!re.test($("#signin_email").val())){
              $("#signin_email").removeClass("valid");
          } else {$("#signin_email").addClass("valid"); }
      
      }); 
      
      
    });
</script>

<div id="model" class="modal" aria-hidden="false"><div class="modal-table"><div class="modal-cell"><div class="signup modal-content">
  <div id="notice" class="alert panel-header alert-header alert-danger alert-error hidden-element"></div>
  <div id="conteiner">
  <div class="panel-padding panel-body">
    
  
<a href="https://www.facebook.com/v2.0/dialog/oauth?client_id=138566025676&amp;redirect_uri=https%3A%2F%2Fru.airbnb.com%2Fauthenticate&amp;scope=email%2Cuser_birthday%2Cuser_likes%2Cuser_education_history%2Cuser_hometown%2Cuser_interests%2Cuser_activities%2Cuser_location%2Cuser_friends" class="fb-button fb-blue btn icon-btn btn-block btn-large large padded-btn-block row-space-1 btn-facebook" data-populate_uri="" data-redirect_uri="https://ru.airbnb.com/authenticate">
	<span class="icon-container">
    <i class="icon icon-facebook"></i>
	</span>
	<span class="text-container">
    Войти через Facebook
  </span>
</a>

  
<a href="/oauth_connect?service=google&amp;from=google_signup" class="btn icon-btn btn-block btn-large large padded-btn-block row-space-1 btn-google">
  <span class="icon-container">
    <i class="icon icon-google-plus"></i>
  </span>
  <span class="text-container">
    Войти, используя Google
  </span>
</a>


  <div class="signup-or-separator">
    <h6 class="text shift text-special">или</h6>
    <hr>
  </div>

<form accept-charset="UTF-8" action="/authenticate" class="signin-form login-form" data-action="Signin" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="V4$.airbnb.com$QSlcfpVWPuk$-IJN8TJEoXNnLvY86ZZyiXW9BqZRZZvaADMLuemQl1A="></div>
  
  

  <div class="control-group row-space-1">
    <input class="decorative-input" id="signin_email" name="email" placeholder="Электронная почта" type="email">
  </div>
  <div class="control-group row-space-2">
    <input class="decorative-input" id="signin_password" name="password" placeholder="Пароль" type="password">
  </div>

  <div class="clearfix row-space-2">
    <label for="remember_me2" class="checkbox remember-me">
      <input type="checkbox" name="remember_me" id="remember_me2" value="true" class="remember_me">
      Запомнить меня
    </label>
    <a href="/forgot_password" class="forgot-password pull-right">Забыли пароль?</a>
  </div>

  <button type="submit" class="btn btn-block btn-primary large btn-large padded-btn-block" id="submit">
    Войти
  </button>
</form>
  </div>
  </div>
  <div class="panel-footer panel-body">
    <div class="text-left">
      Пока не зарегистрированы на Airbnb?
      <a href="/signup_login" class="modal-link" data-modal-href="/signup_modal">
        Зарегистрироваться
</a>    </div>
  </div>
  <form accept-charset="UTF-8" action="/authenticate" class="hidden-element hide in_modal" id="facebook_form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="V4$.airbnb.com$QSlcfpVWPuk$-IJN8TJEoXNnLvY86ZZyiXW9BqZRZZvaADMLuemQl1A="></div>
    
    
</form>
 </div></div></div></div>